package formbeans;

import java.util.ArrayList;
import java.util.List;

import org.mybeans.form.FormBean;

/*
 *  Course: S09-15437 - WEB APPLICATION DEVELOPMENT 
 * 	Name: Jiale Huang
 * 	Andrew ID: jialeh
 * 	Date: 2/23/2009
 *  Assignment: Hw4
 */

public class BookmarkForm extends FormBean{
	
	private String uRL;
	private String comment;

	public String getURL() {
		return uRL;
	}
	public String getComment() {
		return comment;
	}
	public void setURL(String url) {
		uRL = url.trim();
	}
	public void setComment(String comment) {
		this.comment = comment.trim();
	}
	
    public List<String> getValidationErrors() {
        List<String> errors = new ArrayList<String>();

        if (uRL == null || uRL.length() == 0) errors.add("URL is required");
        if (comment == null || comment.length() == 0) errors.add("Comment is required");

        return errors; 	
    }

}
